package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JSplitPane;
import javax.swing.BoxLayout;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.border.LineBorder;

import java.awt.Color;

import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JRadioButton;
import javax.swing.JProgressBar;

import java.awt.FlowLayout;

import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;

import java.awt.Component;

import javax.swing.Box;

import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import java.awt.Font;

public class GetFixed extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JTextField textField_1;
	private JButton btnSales;
	private JTable table;
	private JTextField textField_2;
	private JTextField txtSearch;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					GetFixed frame = new GetFixed();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public GetFixed() {
		setResizable(false);
		setTitle("GetFixed");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 864, 570);

		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);

		JPanel mainMenuPanel = new JPanel();
		mainMenuPanel.setBorder(new LineBorder(Color.LIGHT_GRAY));
		mainMenuPanel.setBounds(10, 11, 838, 36);
		contentPane.add(mainMenuPanel);
		mainMenuPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

		JPanel contentPanel = new JPanel();
		contentPanel.setBorder(new LineBorder(Color.LIGHT_GRAY));
		contentPanel.setBounds(10, 105, 838, 414);
		contentPane.add(contentPanel);
		contentPanel.setLayout(null);
		
		JPanel secondaryMenuPanel = new JPanel();
		secondaryMenuPanel.setBorder(new LineBorder(Color.LIGHT_GRAY));
		secondaryMenuPanel.setBounds(10, 58, 838, 36);
		contentPane.add(secondaryMenuPanel);
		secondaryMenuPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

		btnSales = new JButton("Sales");
		mainMenuPanel.add(btnSales);
		btnSales.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				secondaryMenuPanel.removeAll();

				JButton btnMakeASale = new JButton("Create sale");
				secondaryMenuPanel.add(btnMakeASale);
				btnMakeASale.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						contentPanel.removeAll();

						textField_1 = new JTextField();
						textField_1.setBounds(131, 8, 172, 20);
						contentPanel.add(textField_1);
						textField_1.setColumns(10);

						JLabel lblCustomerId = new JLabel("Customer ID:");
						lblCustomerId.setBounds(10, 11, 111, 14);
						contentPanel.add(lblCustomerId);

						JRadioButton rdbtnNotAMember = new JRadioButton(
								"Not a member");
						rdbtnNotAMember.setBounds(335, 7, 109, 23);
						contentPanel.add(rdbtnNotAMember);
						rdbtnNotAMember.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {

								if (textField_1.isEditable()) {
									textField_1.setText("");
									textField_1.setEditable(false);

								} else {
									textField_1.setEditable(true);

								}
							}
						});

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));

						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null, null, null, null } },
								new String[] { "Barcode", "Name", "Type",
										"Price/pc", "Quantity", "Total" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, String.class, Float.class,
									Integer.class, Float.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}

							boolean[] canEdit = new boolean[] { true, true,
									false, false, true, false };

							public boolean isCellEditable(int rowIndex,
									int columnIndex) {
								return canEdit[columnIndex];
							}
						});

						table.getColumnModel().getColumn(1)
								.setPreferredWidth(130);
						table.getColumnModel().getColumn(2)
								.setPreferredWidth(101);
						table.getColumnModel().getColumn(3)
								.setPreferredWidth(55);
						table.getColumnModel().getColumn(4)
								.setPreferredWidth(53);

						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();
						JButton btnAdd = new JButton("Add");
						btnAdd.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent arg0) {
								//
								model.addRow(new Object[] { null, null, null,
										null, null, null });
							}
						});
						btnAdd.setBounds(635, 11, 89, 23);
						contentPanel.add(btnAdd);

						JButton btnRemove = new JButton("Remove");
						btnRemove.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								if (table.getSelectedRow() != -1) {
									// remove selected row from the model
									model.removeRow(table.getSelectedRow());
								}
							}
						});
						btnRemove.setBounds(739, 11, 89, 23);
						contentPanel.add(btnRemove);

						JLabel lblTotalPrice = new JLabel("Total price:");
						lblTotalPrice
								.setHorizontalAlignment(SwingConstants.TRAILING);
						lblTotalPrice.setBounds(548, 380, 72, 23);
						contentPanel.add(lblTotalPrice);

						textField_2 = new JTextField();
						textField_2.setBounds(630, 380, 86, 23);
						contentPanel.add(textField_2);
						textField_2.setColumns(10);

						JButton btnSubmit = new JButton("Submit");
						btnSubmit.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnSubmit.setBounds(739, 380, 89, 23);
						contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				JButton btnShowSale = new JButton("Show sale");
				secondaryMenuPanel.add(btnShowSale);

				JButton btnDeleteSale = new JButton("Delete sale");
				secondaryMenuPanel.add(btnDeleteSale);

				invalidate();
				revalidate();
				repaint();
				setVisible(true);

			}
		});

		JButton btnLeases = new JButton("Leases");
		btnLeases.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				secondaryMenuPanel.removeAll();

				JButton btnStartLease = new JButton("Start lease");
				secondaryMenuPanel.add(btnStartLease);

				JButton btnShowLease = new JButton("Show lease");
				secondaryMenuPanel.add(btnShowLease);

				JButton btnEndLease = new JButton("End lease");
				secondaryMenuPanel.add(btnEndLease);

				JButton btnDeleteLease = new JButton("Delete lease");
				secondaryMenuPanel.add(btnDeleteLease);
				invalidate();
				revalidate();
				repaint();
				setVisible(true);

			}
		});
		mainMenuPanel.add(btnLeases);

		JButton btnOrders = new JButton("Orders");
		btnOrders.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				secondaryMenuPanel.removeAll();

				JButton btnCreateOrder = new JButton("Create order");
				secondaryMenuPanel.add(btnCreateOrder);

				JButton btnShowOrder = new JButton("Show order");
				secondaryMenuPanel.add(btnShowOrder);

				JButton btnDeleteOrder = new JButton("Delete order");
				secondaryMenuPanel.add(btnDeleteOrder);

				invalidate();
				revalidate();
				repaint();
				setVisible(true);

			}
		});
		mainMenuPanel.add(btnOrders);

		JButton btnProducts = new JButton("Products");
		btnProducts.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				secondaryMenuPanel.removeAll();

				JButton btnAddProduct = new JButton("Add product");
				secondaryMenuPanel.add(btnAddProduct);
				btnAddProduct.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						contentPanel.removeAll();
						
						JRadioButton rdbtnAalborg = new JRadioButton("Aalborg");
						rdbtnAalborg.setBounds(22, 11, 109, 23);
						contentPanel.add(rdbtnAalborg);
						
						JRadioButton rdbtnAarhus = new JRadioButton("Aarhus");
						rdbtnAarhus.setBounds(133, 11, 109, 23);
						contentPanel.add(rdbtnAarhus);
						
						JRadioButton rdbtnOdense = new JRadioButton("Odense");
						rdbtnOdense.setBounds(244, 11, 109, 23);
						contentPanel.add(rdbtnOdense);
						
						JRadioButton rdbtnCopenhagen = new JRadioButton("Copenhagen");
						rdbtnCopenhagen.setBounds(355, 11, 109, 23);
						contentPanel.add(rdbtnCopenhagen);

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null, null, null, null, null, null,
								null, null } }, new String[] { "Barcode",
								"Name", "Selling price", "Leasing price",
								"Price discount", "Amount discount", "Amount",
								"Min amount", "Max amount" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class, Float.class,
									Float.class, Integer.class, Integer.class,
									Integer.class, Integer.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}
						});
						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();
						JButton btnAdd = new JButton("Add");
						btnAdd.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent arg0) {
								//
								model.addRow(new Object[] { null, null, null,
										null, null, null, null, null, null,
										null });
							}
						});
						btnAdd.setBounds(635, 11, 89, 23);
						contentPanel.add(btnAdd);

						JButton btnRemove = new JButton("Remove");
						btnRemove.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								if (table.getSelectedRow() != -1) {
									// remove selected row from the model
									model.removeRow(table.getSelectedRow());
								}
							}
						});
						btnRemove.setBounds(739, 11, 89, 23);
						contentPanel.add(btnRemove);

						JButton btnSubmit = new JButton("Submit");
						btnSubmit.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnSubmit.setBounds(739, 380, 89, 23);
						contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				JButton btnShowProduct = new JButton("Show product");
				secondaryMenuPanel.add(btnShowProduct);
				btnShowProduct.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						contentPanel.removeAll();

						txtSearch = new JTextField();
						txtSearch.setBounds(15, 11, 86, 25);
						contentPanel.add(txtSearch);
						txtSearch.setColumns(10);

						JButton btnSearch = new JButton("Search");
						btnSearch.setBounds(111, 11, 89, 25);
						contentPanel.add(btnSearch);
						
						JRadioButton rdbtnAalborg = new JRadioButton("Aalborg");
						rdbtnAalborg.setBounds(222, 11, 109, 23);
						contentPanel.add(rdbtnAalborg);
						
						JRadioButton rdbtnAarhus = new JRadioButton("Aarhus");
						rdbtnAarhus.setBounds(333, 11, 109, 23);
						contentPanel.add(rdbtnAarhus);
						
						JRadioButton rdbtnOdense = new JRadioButton("Odense");
						rdbtnOdense.setBounds(444, 11, 109, 23);
						contentPanel.add(rdbtnOdense);
						
						JRadioButton rdbtnCopenhagen = new JRadioButton("Copenhagen");
						rdbtnCopenhagen.setBounds(555, 11, 109, 23);
						contentPanel.add(rdbtnCopenhagen);

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null, null, null, null, null, null,
								null, null } }, new String[] { "Barcode",
								"Name", "Selling price", "Leasing price",
								"Price discount", "Amount discount", "Amount",
								"Min amount", "Max amount" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class, Float.class,
									Float.class, Integer.class, Integer.class,
									Integer.class, Integer.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}

							boolean[] canEdit = new boolean[] { false, false,
									false, false, false, false, false, false,
									false };

							public boolean isCellEditable(int rowIndex,
									int columnIndex) {
								return canEdit[columnIndex];
							}
						});
						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();

						// JButton btnAdd = new JButton("Add");
						// btnAdd.addActionListener(new ActionListener() {
						// public void actionPerformed(ActionEvent arg0) {
						// //
						// model.addRow(new Object[] { null, null, null,
						// null, null, null, null, null, null,
						// null });
						// }
						// });
						// btnAdd.setBounds(635, 11, 89, 23);
						// contentPanel.add(btnAdd);
						//
						// JButton btnRemove = new JButton("Remove");
						// btnRemove.addActionListener(new ActionListener() {
						// public void actionPerformed(ActionEvent e) {
						// if (table.getSelectedRow() != -1) {
						// // remove selected row from the model
						// model.removeRow(table.getSelectedRow());
						// }
						// }
						// });
						// btnRemove.setBounds(739, 11, 89, 23);
						// contentPanel.add(btnRemove);

						JButton btnUpdate = new JButton("Update");
						btnUpdate.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnUpdate.setBounds(639, 380, 89, 23);
						contentPanel.add(btnUpdate);

						JButton btnDelete = new JButton("Delete");
						btnDelete.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnDelete.setBounds(739, 380, 89, 23);
						contentPanel.add(btnDelete);

						// JButton btnSubmit = new JButton("Submit");
						// btnSubmit.addActionListener(new ActionListener() {
						// public void actionPerformed(ActionEvent e) {
						// }
						// });
						// btnSubmit.setBounds(739, 380, 89, 23);
						// contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				JButton btnUpdateProduct = new JButton("Update product");
				secondaryMenuPanel.add(btnUpdateProduct);
				btnUpdateProduct.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						contentPanel.removeAll();

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null, null, null, null, null, null,
								null, null } }, new String[] { "Barcode",
								"Name", "Selling price", "Leasing price",
								"Price discount", "Amount discount", "Amount",
								"Min amount", "Max amount" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class, Float.class,
									Float.class, Integer.class, Integer.class,
									Integer.class, Integer.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}
						});

						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();
						JButton btnAdd = new JButton("Add");
						btnAdd.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent arg0) {
								//
								model.addRow(new Object[] { null, null, null,
										null, null, null, null, null, null,
										null });
							}
						});
						btnAdd.setBounds(635, 11, 89, 23);
						contentPanel.add(btnAdd);

						JButton btnRemove = new JButton("Remove");
						btnRemove.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								if (table.getSelectedRow() != -1) {
									// remove selected row from the model
									model.removeRow(table.getSelectedRow());
								}
							}
						});
						btnRemove.setBounds(739, 11, 89, 23);
						contentPanel.add(btnRemove);

						JButton btnSubmit = new JButton("Update");
						btnSubmit.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnSubmit.setBounds(739, 380, 89, 23);
						contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				JButton btnDeleteProduct = new JButton("Delete product");
				secondaryMenuPanel.add(btnDeleteProduct);
				btnDeleteProduct.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						contentPanel.removeAll();

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null, null, null, null, null, null,
								null, null } }, new String[] { "Barcode",
								"Name", "Selling price", "Leasing price",
								"Price discount", "Amount discount", "Amount",
								"Min amount", "Max amount" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class, Float.class,
									Float.class, Integer.class, Integer.class,
									Integer.class, Integer.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}

							boolean[] canEdit = new boolean[] { false, false,
									false, false, false, false, false, false,
									false };

							public boolean isCellEditable(int rowIndex,
									int columnIndex) {
								return canEdit[columnIndex];
							}
						});
						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();
						JButton btnAdd = new JButton("Add");
						btnAdd.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent arg0) {
								//
								model.addRow(new Object[] { null, null, null,
										null, null, null, null, null, null,
										null });
							}
						});
						btnAdd.setBounds(635, 11, 89, 23);
						contentPanel.add(btnAdd);

						JButton btnRemove = new JButton("Remove");
						btnRemove.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								if (table.getSelectedRow() != -1) {
									// remove selected row from the model
									model.removeRow(table.getSelectedRow());
								}
							}
						});
						btnRemove.setBounds(739, 11, 89, 23);
						contentPanel.add(btnRemove);

						JButton btnSubmit = new JButton("Delete");
						btnSubmit.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnSubmit.setBounds(739, 380, 89, 23);
						contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				invalidate();
				revalidate();
				repaint();
				setVisible(true);

			}
		});
		mainMenuPanel.add(btnProducts);

		JButton btnServices = new JButton("Services");
		btnServices.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				secondaryMenuPanel.removeAll();

				JButton btnAddService = new JButton("Add service");
				secondaryMenuPanel.add(btnAddService);
				btnAddService.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {

						contentPanel.removeAll();
						
						JRadioButton rdbtnAalborg = new JRadioButton("Aalborg");
						rdbtnAalborg.setBounds(22, 11, 109, 23);
						contentPanel.add(rdbtnAalborg);
						
						JRadioButton rdbtnAarhus = new JRadioButton("Aarhus");
						rdbtnAarhus.setBounds(133, 11, 109, 23);
						contentPanel.add(rdbtnAarhus);
						
						JRadioButton rdbtnOdense = new JRadioButton("Odense");
						rdbtnOdense.setBounds(244, 11, 109, 23);
						contentPanel.add(rdbtnOdense);
						
						JRadioButton rdbtnCopenhagen = new JRadioButton("Copenhagen");
						rdbtnCopenhagen.setBounds(355, 11, 109, 23);
						contentPanel.add(rdbtnCopenhagen);

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null } }, new String[] { "Barcode",
								"Name", "Price" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}

							boolean[] canEdit = new boolean[] { false, false,
									false };

							public boolean isCellEditable(int rowIndex,
									int columnIndex) {
								return canEdit[columnIndex];
							}
						});
						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();

						JButton btnAdd = new JButton("Add");
						btnAdd.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent arg0) {
								//
								model.addRow(new Object[] { null, null, null });
							}
						});
						btnAdd.setBounds(635, 11, 89, 23);
						contentPanel.add(btnAdd);

						JButton btnRemove = new JButton("Remove");
						btnRemove.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								if (table.getSelectedRow() != -1) {
									// remove selected row from the model
									model.removeRow(table.getSelectedRow());
								}
							}
						});
						btnRemove.setBounds(739, 11, 89, 23);
						contentPanel.add(btnRemove);

						JButton btnSubmit = new JButton("Submit");
						btnSubmit.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnSubmit.setBounds(739, 380, 89, 23);
						contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				JButton btnShowService = new JButton("Show service");
				secondaryMenuPanel.add(btnShowService);
				btnShowService.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {

						contentPanel.removeAll();

						txtSearch = new JTextField();
						txtSearch.setBounds(15, 11, 86, 25);
						contentPanel.add(txtSearch);
						txtSearch.setColumns(10);

						JButton btnSearch = new JButton("Search");
						btnSearch.setBounds(111, 11, 89, 25);
						contentPanel.add(btnSearch);
						
						JRadioButton rdbtnAalborg = new JRadioButton("Aalborg");
						rdbtnAalborg.setBounds(222, 11, 109, 23);
						contentPanel.add(rdbtnAalborg);
						
						JRadioButton rdbtnAarhus = new JRadioButton("Aarhus");
						rdbtnAarhus.setBounds(333, 11, 109, 23);
						contentPanel.add(rdbtnAarhus);
						
						JRadioButton rdbtnOdense = new JRadioButton("Odense");
						rdbtnOdense.setBounds(444, 11, 109, 23);
						contentPanel.add(rdbtnOdense);
						
						JRadioButton rdbtnCopenhagen = new JRadioButton("Copenhagen");
						rdbtnCopenhagen.setBounds(555, 11, 109, 23);
						contentPanel.add(rdbtnCopenhagen);

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null } }, new String[] { "Barcode",
								"Name", "Price" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}

							boolean[] canEdit = new boolean[] { false, false,
									false };

							public boolean isCellEditable(int rowIndex,
									int columnIndex) {
								return canEdit[columnIndex];
							}
						});
						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();

						// JButton btnAdd = new JButton("Add");
						// btnAdd.addActionListener(new ActionListener() {
						// public void actionPerformed(ActionEvent arg0) {
						// //
						// model.addRow(new Object[] { null, null, null });
						// }
						// });
						// btnAdd.setBounds(635, 11, 89, 23);
						// contentPanel.add(btnAdd);
						//
						// JButton btnRemove = new JButton("Remove");
						// btnRemove.addActionListener(new ActionListener() {
						// public void actionPerformed(ActionEvent e) {
						// if (table.getSelectedRow() != -1) {
						// // remove selected row from the model
						// model.removeRow(table.getSelectedRow());
						// }
						// }
						// });
						// btnRemove.setBounds(739, 11, 89, 23);
						// contentPanel.add(btnRemove);

						JButton btnUpdate = new JButton("Update");
						btnUpdate.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnUpdate.setBounds(639, 380, 89, 23);
						contentPanel.add(btnUpdate);

						JButton btnDelete = new JButton("Delete");
						btnDelete.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnDelete.setBounds(739, 380, 89, 23);
						contentPanel.add(btnDelete);

						// JButton btnSubmit = new JButton("Show");
						// btnSubmit.addActionListener(new ActionListener() {
						// public void actionPerformed(ActionEvent e) {
						// }
						// });
						// btnSubmit.setBounds(739, 380, 89, 23);
						// contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				JButton btnUpdateService = new JButton("Update service");
				secondaryMenuPanel.add(btnUpdateService);
				btnUpdateService.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {

						contentPanel.removeAll();

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null } }, new String[] { "Barcode",
								"Name", "Price" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}

							boolean[] canEdit = new boolean[] { false, false,
									false };

							public boolean isCellEditable(int rowIndex,
									int columnIndex) {
								return canEdit[columnIndex];
							}
						});
						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();

						JButton btnAdd = new JButton("Add");
						btnAdd.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent arg0) {
								//
								model.addRow(new Object[] { null, null, null });
							}
						});
						btnAdd.setBounds(635, 11, 89, 23);
						contentPanel.add(btnAdd);

						JButton btnRemove = new JButton("Remove");
						btnRemove.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								if (table.getSelectedRow() != -1) {
									// remove selected row from the model
									model.removeRow(table.getSelectedRow());
								}
							}
						});
						btnRemove.setBounds(739, 11, 89, 23);
						contentPanel.add(btnRemove);

						JButton btnSubmit = new JButton("Update");
						btnSubmit.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnSubmit.setBounds(739, 380, 89, 23);
						contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				JButton btnDeleteService = new JButton("Delete service");
				secondaryMenuPanel.add(btnDeleteService);
				btnDeleteService.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {

						contentPanel.removeAll();

						table = new JTable();
						table.setFont(new Font("Tahoma", Font.PLAIN, 15));
						table.setModel(new DefaultTableModel(new Object[][] { {
								null, null, null } }, new String[] { "Barcode",
								"Name", "Price" }) {
							Class[] columnTypes = new Class[] { Integer.class,
									String.class, Float.class };

							public Class getColumnClass(int columnIndex) {
								return columnTypes[columnIndex];
							}

							boolean[] canEdit = new boolean[] { false, false,
									false };

							public boolean isCellEditable(int rowIndex,
									int columnIndex) {
								return canEdit[columnIndex];
							}
						});
						table.setBounds(10, 27, 588, 195);
						JScrollPane scrollPane = new JScrollPane(table);
						scrollPane.setBounds(10, 52, 818, 300);
						table.setFillsViewportHeight(true);
						contentPanel.add(scrollPane);
						DefaultTableModel model = (DefaultTableModel) table
								.getModel();

						JButton btnAdd = new JButton("Add");
						btnAdd.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent arg0) {
								//
								model.addRow(new Object[] { null, null, null });
							}
						});
						btnAdd.setBounds(635, 11, 89, 23);
						contentPanel.add(btnAdd);

						JButton btnRemove = new JButton("Remove");
						btnRemove.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								if (table.getSelectedRow() != -1) {
									// remove selected row from the model
									model.removeRow(table.getSelectedRow());
								}
							}
						});
						btnRemove.setBounds(739, 11, 89, 23);
						contentPanel.add(btnRemove);

						JButton btnSubmit = new JButton("Delete");
						btnSubmit.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
							}
						});
						btnSubmit.setBounds(739, 380, 89, 23);
						contentPanel.add(btnSubmit);

						invalidate();
						revalidate();
						repaint();
						setVisible(true);

					}
				});

				invalidate();
				revalidate();
				repaint();
				setVisible(true);
			}
		});
		mainMenuPanel.add(btnServices);

		JButton btnCustomers = new JButton("Customers");
		btnCustomers.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				secondaryMenuPanel.removeAll();

				JButton btnAddCustomer = new JButton("Add customer");
				secondaryMenuPanel.add(btnAddCustomer);

				JButton btnShowCustomer = new JButton("Show customer");
				secondaryMenuPanel.add(btnShowCustomer);

				JButton btnUpdateCustomer = new JButton("Update customer");
				secondaryMenuPanel.add(btnUpdateCustomer);

				JButton btnDeleteCustomer = new JButton("Delete customer");
				secondaryMenuPanel.add(btnDeleteCustomer);

				invalidate();
				revalidate();
				repaint();
				setVisible(true);
			}
		});
		mainMenuPanel.add(btnCustomers);

		JButton btnEmployees = new JButton("Employees ");
		btnEmployees.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				secondaryMenuPanel.removeAll();

				JButton btnAddEmployee = new JButton("Add employee");
				secondaryMenuPanel.add(btnAddEmployee);

				JButton btnShowEmployee = new JButton("Show employee");
				secondaryMenuPanel.add(btnShowEmployee);

				JButton btnUpdateEmployee = new JButton("Update employee");
				secondaryMenuPanel.add(btnUpdateEmployee);

				JButton btnDeleteEmployee = new JButton("Delete employee");
				secondaryMenuPanel.add(btnDeleteEmployee);

				invalidate();
				revalidate();
				repaint();
				setVisible(true);
			}
		});
		mainMenuPanel.add(btnEmployees);

		JButton btnStatistics = new JButton("Statictics");
		mainMenuPanel.add(btnStatistics);

		JButton btnLogout = new JButton("Logout");
		mainMenuPanel.add(btnLogout);

	}

	public JButton getBtnSales() {
		return btnSales;
	}
}
